using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace NoteManger
{
	public class FrmViewFeedBack : Form
	{
		private NoteRemote _NoteRemoteObject = null;
		private TLoginInfo _LoginInfo = new TLoginInfo();
		private IContainer components = null;
		private ListView listViewFeedBack;
		private ImageList imageList;
		private Label label1;
		public NoteRemote NoteRemoteObject
		{
			set
			{
				this._NoteRemoteObject = value;
			}
		}
		public TLoginInfo LoginInfo
		{
			set
			{
				this._LoginInfo = value;
			}
		}
		public FrmViewFeedBack()
		{
			this.InitializeComponent();
			this.CreateColumn();
		}
		private void CreateColumn()
		{
			ColumnHeader columnHeader = new ColumnHeader();
			columnHeader.Text = "编号";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "审核人ID";
			columnHeader.Width = 90;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "审核人姓名";
			columnHeader.Width = 90;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "日志所有者ID";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "日志所有者姓名";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "日志日期";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "反馈信息";
			columnHeader.Width = 250;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "发送者";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "发送日期";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "发送时间";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewFeedBack.Columns.Add(columnHeader);
		}
		private void GetWorkNoteAuditFeedBack()
		{
			if (this._NoteRemoteObject != null)
			{
				try
				{
					if (!this._NoteRemoteObject.ConnectionTest())
					{
						MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						return;
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
				string[,] array = new string[0, 0];
				string text = "";
				if (this._NoteRemoteObject.GetWorkNoteAuditFeedBack(this._LoginInfo.LoginID, ref array, ref text))
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					this.listViewFeedBack.BeginUpdate();
					this.listViewFeedBack.Items.Clear();
					for (int i = 0; i < num; i++)
					{
						ListViewItem listViewItem = new ListViewItem();
						listViewItem.Text = array[i, 0];
						listViewItem.SubItems.Add(array[i, 1]);
						listViewItem.SubItems.Add(array[i, 2]);
						listViewItem.SubItems.Add(array[i, 3]);
						listViewItem.SubItems.Add(array[i, 4]);
						listViewItem.SubItems.Add(array[i, 5]);
						listViewItem.SubItems.Add(array[i, 6]);
						listViewItem.SubItems.Add(array[i, 7]);
						listViewItem.SubItems.Add(array[i, 8]);
						listViewItem.SubItems.Add(array[i, 9]);
						this.listViewFeedBack.Items.Add(listViewItem);
					}
					this.listViewFeedBack.EndUpdate();
					this.listViewFeedBack.Refresh();
				}
			}
		}
		private void FrmViewFeedBack_Shown(object sender, EventArgs e)
		{
			this.GetWorkNoteAuditFeedBack();
		}
		private void listViewFeedBack_DoubleClick(object sender, EventArgs e)
		{
			if (this._NoteRemoteObject != null)
			{
				if (this.listViewFeedBack.SelectedItems.Count != 0)
				{
					if (MessageBox.Show("确定要更新这条反馈信息为“已处理”状态吗？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)
					{
						try
						{
							if (!this._NoteRemoteObject.ConnectionTest())
							{
								MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								return;
							}
						}
						catch (Exception ex)
						{
							MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							return;
						}
						string text = this.listViewFeedBack.SelectedItems[0].Text;
						string text2 = "";
						if (!this._NoteRemoteObject.SetWorkNoteAuditFeedBack(text, ref text2))
						{
							MessageBox.Show(text2, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
						else
						{
							this.GetWorkNoteAuditFeedBack();
							if (this.listViewFeedBack.Items.Count == 0)
							{
								base.Close();
							}
						}
					}
				}
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrmViewFeedBack));
			this.listViewFeedBack = new ListView();
			this.imageList = new ImageList(this.components);
			this.label1 = new Label();
			base.SuspendLayout();
			this.listViewFeedBack.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.listViewFeedBack.FullRowSelect = true;
			this.listViewFeedBack.GridLines = true;
			this.listViewFeedBack.HideSelection = false;
			this.listViewFeedBack.Location = new System.Drawing.Point(3, 3);
			this.listViewFeedBack.MultiSelect = false;
			this.listViewFeedBack.Name = "listViewFeedBack";
			this.listViewFeedBack.Size = new System.Drawing.Size(667, 387);
			this.listViewFeedBack.SmallImageList = this.imageList;
			this.listViewFeedBack.TabIndex = 7;
			this.listViewFeedBack.UseCompatibleStateImageBehavior = false;
			this.listViewFeedBack.View = View.Details;
			this.listViewFeedBack.DoubleClick += new EventHandler(this.listViewFeedBack_DoubleClick);
			this.imageList.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList.ImageStream");
			this.imageList.TransparentColor = System.Drawing.Color.Transparent;
			this.imageList.Images.SetKeyName(0, "overlays.png");
			this.imageList.Images.SetKeyName(1, "application_put.png");
			this.imageList.Images.SetKeyName(2, "layout.png");
			this.imageList.Images.SetKeyName(3, "layout_add.png");
			this.imageList.Images.SetKeyName(4, "layout_error.png");
			this.label1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.label1.AutoSize = true;
			this.label1.Font = new System.Drawing.Font("宋体", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaption;
			this.label1.Location = new System.Drawing.Point(1, 398);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(455, 14);
			this.label1.TabIndex = 8;
			this.label1.Text = "如果确认某条审核复核反馈信息您已经处理，请双击条目，更新其状态！";
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(674, 419);
			base.Controls.Add(this.label1);
			base.Controls.Add(this.listViewFeedBack);
			base.Name = "FrmViewFeedBack";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "未处理的审核复核反馈信息";
			base.Shown += new EventHandler(this.FrmViewFeedBack_Shown);
			base.ResumeLayout(false);
			base.PerformLayout();
		}
	}
}
